package com.example.football;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;

public class NewsAcitivity extends AppCompatActivity {

    TextView tv_title;
    TextView tv_author;
    TextView tv_context;

    static public String title;
    static public String author;
    static public String context;
    static public Integer newsid;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_news);

        ActionBar actionBar=getSupportActionBar();
        if(actionBar!=null){
            actionBar.hide();
        }

        Intent intent=getIntent();
        newsid= intent.getIntExtra("newsid",0);
        title = intent.getStringExtra("title");
        context = intent.getStringExtra("context");
        author = intent.getStringExtra("author");

        tv_title =  findViewById(R.id.tv_title);
        tv_author = findViewById(R.id.tv_author);
        tv_context = findViewById(R.id.tv_context);
        tv_title.setText(title);
        tv_author.setText("作者:"+author);
        tv_context.setText("        "+context);


    }
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.news_iv_back:
                finish();
                break;
        }
    }
}
